extends "../i_horse/i_horse.gd"

func init():
	.init()
	name = "白色闪电"
	resetdata()
	info = "异种良驱：闪现至敌方血量最低单位周围，对其造成(物攻+自身闪避率*10)点魔法伤害并返回[cd:3秒]\n" + info

func _connect():
	._connect()

func _upS():
	._upS()
	cnt2 += 1
	if cnt2 == 3:
		cnt2 = 0
		yzlq()

func yzlq():
	var chas = masCha.getAllChas(1)
	chas.sort_custom(self,"sort")
	masCha.ying(chas[0].position,masCha.position)
	yield(sys.get_tree().create_timer(0.01),"timeout")
	masCha.hurtChara(chas[0],att.atk + att.dod * 1000,Chara.HurtType.MGI,Chara.AtkType.SKILL)
	masCha.ying(masCha.position,chas[0].position)
	
func sort(a,b):
	return a.att.hp < b.att.hp
	
